<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "b_course_item".
 *
 * @property string $id
 * @property string $pid
 * @property string $course_id 课程id
 * @property string $type 类型(章/节/作业/考试/活动)
 * @property string $is_leaf 是否叶子节点
 * @property string $title 标题
 * @property string $content 内容
 * @property int $sequence 排序
 * @property string $state 状态
 * @property string $create_by 创建者
 * @property string $create_time 创建时间
 * @property string $update_by 更新者
 * @property string $update_time 更新时间
 * @property int $is_public 是否公开
 * @property int $del_flag 删除标识
 */
class BCourseItem extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'b_course_item';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id'], 'required'],
            [['sequence', 'is_public', 'del_flag'], 'integer'],
            [['create_time', 'update_time'], 'safe'],
            [['id', 'pid', 'course_id', 'create_by', 'update_by'], 'string', 'max' => 36],
            [['type', 'is_leaf', 'title', 'state'], 'string', 'max' => 255],
            [['content'], 'string', 'max' => 4000],
            [['id'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'pid' => 'Pid',
            'course_id' => 'Course ID',
            'type' => 'Type',
            'is_leaf' => 'Is Leaf',
            'title' => 'Title',
            'content' => 'Content',
            'sequence' => 'Sequence',
            'state' => 'State',
            'create_by' => 'Create By',
            'create_time' => 'Create Time',
            'update_by' => 'Update By',
            'update_time' => 'Update Time',
            'is_public' => 'Is Public',
            'del_flag' => 'Del Flag',
        ];
    }
}
